package inventoryServe.service.impl;


import inventoryServe.mapper.SupplierMapper;
import inventoryServe.po.Supplier;
import inventoryServe.service.SupplierService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class SupplierServiceImpl  implements SupplierService {
    // 注解注入
    @Autowired
    private SupplierMapper supplierMapper;

    @Override
    public List<Supplier> allSupplier(Supplier supplier) {
        return this.supplierMapper.allSupplier(supplier);
    }

    @Override
    public Boolean deleteSupplier(Integer id) {

        return supplierMapper.deleteSupplier(id) > 0 ;
    }

    @Override
    public Boolean addSupplier(Supplier supplier) {

        return supplierMapper.addSupplier(supplier) > 0 ;
    }

    @Override
    public Supplier supplierOfId(Integer id) {

        return supplierMapper.supplierOfId(id);
    }

    @Override
    public Boolean editSupplier(Supplier supplier) {
        return supplierMapper.editSupplier(supplier)>0;
    }
}
